Skip to content

Conversation

@Zebradil
Copy link

This fixes the issue when files like foo-main.yaml are incorrectly recognized as ansible files.

This fixes the issue when files like `foo-main.yaml` are incorrectly recognized as ansible files.
@bfoersterling
Copy link
Contributor

With this change naming patterns like do_stuff_playbook.yaml would no longer work.
And using a playbooks dir has its downsides (i.e. adjusting the paths for roles).

@Zebradil
Copy link
Author

Thanks for pointing that out. I'm not very familiar with ansible in general, so I don't know common naming patterns and edge cases. What would be the way to stop this plugin from marking files like .github/workflows/flow-main.yaml as ansible files?

Also feel free to close the PR if you don't think it can be merged.

@pearofducks
Copy link
Owner

You should be able to override the configuration with this change locally instead of in this plugin. I use neovim now but IIRC you can override the augroup in your local config to set whatever detection you'd like.

@Zebradil
Copy link
Author

This is what I did as a workaround back in the days:

ansible_ftdetect_filename_regex = "\\v^(playbook|site|main|local|requirements|bar)\\.ya?ml$"

I just thought that maybe we can craft a more precise regex to cover my case without braking others.
I'll close the PR.

Thanks for taking a look into that!

@Zebradil Zebradil closed this Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants